var assert = require('assert');
var should = require('should');
var util = require('util');
var zlib = require('zlib');
var _ = require('lodash');
var genEquipService = require('../../app/services/genEquipService');
var dataApi = require('../../app/libs/dataApi');
var config = require('../config');

suite('测试genEquipService', function () {
    suite('generateAdditiveAttr', function () {
        test('生成装备的随机属性', function () {
            assert.equal(genEquipService.generateAdditiveAttr(1054000, 1) == null, false);
        });
    });

    suite('generateEquip', function () {
        test('生成装备', function () {
            this.timeout(999999);
            var equipment_conf = dataApi.equipment_type.all();
            _.each(equipment_conf, function (equipment, key) {
                var equip = genEquipService.generateEquip(key);
                assert.equal(equip.equip_type == key, true);
                assert.equal(equip != null, true);
            });
        });
    });
});
